package com.aspose.cells;

final class zbtp {
   public static void a(zif var0, zbtn var1) throws Exception {
      if (!(var1.e().b() instanceof zbo) || !var0.B().D()) {
         ziw var2 = var1.e();
         if (var1.j()) {
            zn var3 = var0.ap();
            var1.e().z();
            com.aspose.cells.b.a.b.zp var4 = var1.e().a;
            com.aspose.cells.b.a.b.zc var5 = zax.a(var1.e().d(), com.aspose.cells.a.c.zn.a(var4));

            try {
               var3.a(var5, var4);
            } finally {
               if (var5 != null) {
                  var5.f();
               }

            }

            if (var1.e().f().e()) {
               var3.a(zama.a(var1.e().f()), var4);
            }

            int var6 = var0.ap().j();
            if (var0.i().d().g() && var1.e().d().g() && var0.ap().j() != 4) {
               var0.ap().b(4);
            }

            a(var0.ap(), var2.a, var1.b(), var1.f(), var2.h(), var2.j(), var1.g(), var1.h(), var1.i());
            if (var0.i().d().g() && var2.d().g() && var0.ap().j() != var6) {
               var0.ap().b(var6);
            }
         }

      }
   }

   public static void a(zif var0, zrm var1) throws Exception {
      if (var1.d() != 0 && var1.l()) {
         zn var2 = var0.ap();
         ziw var3 = var1.b();
         var3.z();
         com.aspose.cells.b.a.b.zp var4 = var3.a;
         com.aspose.cells.b.a.b.zc var5 = zax.a(var3.d(), com.aspose.cells.a.c.zn.a(var4));

         try {
            var2.a(var5, var4);
         } finally {
            if (var5 != null) {
               var5.f();
            }

         }

         if (var3.f().e()) {
            var2.a(zama.a(var3.f()), var4);
         }

         a(var0.ap(), var3.a, var1.g(), var1.h(), var3.h(), var3.j(), var1.i(), var1.j(), var1.k());
      }

   }

   public static com.aspose.cells.b.a.b.zs a(zif var0, zrm var1, com.aspose.cells.b.a.b.zt var2, com.aspose.cells.b.a.b.zp var3) {
      ziw var4 = var1.b();
      com.aspose.cells.b.a.b.zs var5 = new com.aspose.cells.b.a.b.zs(0, 0);
      if (var1.d() != 0 && var1.l()) {
         var5 = zbsp.a(var0.ap(), var1.g(), var1.h(), var4.h(), var2, var1.i(), var1.j());
         var4.e(var3.e());
         var4.f(var3.f());
      }

      var4.b.a(var5);
      return var5;
   }

   public static com.aspose.cells.b.a.b.zs a(zn var0, zbtn var1, com.aspose.cells.b.a.b.zt var2) {
      com.aspose.cells.b.a.b.zs var3 = zbsp.a(var0, var1.b(), var1.f(), var1.e().h(), var2, var1.g(), var1.h());
      return var3;
   }

   public static void a(zn var0, com.aspose.cells.b.a.b.zp var1, String var2, int var3, com.aspose.cells.b.a.b.zg var4, Color var5, int var6, int var7, int var8) {
      com.aspose.cells.b.a.b.zv var9 = new com.aspose.cells.b.a.b.zv();
      var9.a(zbsp.a(var6));
      var9.c(zbsp.a(var7));
      switch(Math.abs(var3)) {
      case 0:
         var0.a(var2, var4, new com.aspose.cells.b.a.b.zu(var5), (com.aspose.cells.b.a.b.zp)var1, var9);
         break;
      case 90:
         var0.b((float)(var1.g() + var1.e() / 2), (float)(var1.h() + var1.f() / 2));
         var0.a((float)(-var3));
         var1 = new com.aspose.cells.b.a.b.zp(-var1.f() / 2, -var1.e() / 2, var1.f(), var1.e());
         var0.a(var2, var4, new com.aspose.cells.b.a.b.zu(var5), (com.aspose.cells.b.a.b.zp)var1, var9);
         var0.d();
         break;
      case 255:
         zbsp.a(var0, var2, var4, var5, (float)var1.c(), (float)var1.d(), (float)var1.e(), (float)var1.f(), var8);
         break;
      default:
         double var10 = Math.sqrt(Math.pow((double)var1.e(), 2.0D) + Math.pow((double)var1.f(), 2.0D));
         var9.b(4096);
         com.aspose.cells.b.a.b.zt var12 = var0.a(var2, var4, (int)var10, var9);
         var0.b((float)(var1.g() + var1.e() / 2), (float)(var1.h() + var1.f() / 2));
         var0.a((float)(-var3));
         com.aspose.cells.b.a.b.zq var13 = new com.aspose.cells.b.a.b.zq(-var12.b() / 2.0F, -var12.c() / 2.0F, var12.b(), var12.c());
         var0.a(var2, var4, new com.aspose.cells.b.a.b.zu(var5), (com.aspose.cells.b.a.b.zq)var13, var9);
         var0.d();
      }

   }
}
